<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Logout extends CI_Controller {
	
	function __construct(){
		
		parent::__construct();
		$this->load->model('login_model','',TRUE);
		
	}

	function index(){
		
		if(!$this->session->userdata('username'))
        {
            redirect('login');
			
         } else {
		
		//$this->session->sess_destroy();
		$array_items = array('username' => '', 'user_id' => '');
		$this->session->unset_userdata($array_items);		
		$data['success']='Logout Success';
		//$data['header_theme']=$this->load->view('admin/header-login');
		//$data['log_topNav']=$this->load->view('admin/header-topNav');		
		$this->load->view('login',$data );
		//redirect('front/main',$data);
		
		}
		
	}

}
?>